package com.qfedu.springboot1.controller;

import com.qfedu.springboot1.entity.Question;
import com.qfedu.springboot1.service.CharacterService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/10/31 16:45
 * @Modified:
 */
@RestController
@RequestMapping("api/mbti")
@Tag(name = "人格测试")
public class CharacterController {
    @Autowired
    private CharacterService service;

    @Operation(summary = "开始人格测试")
    @GetMapping("starttest")
    public Question startTest(){
        return service.queryQuestions();
    }
    @PostMapping("answer")
    @Operation(summary = "回答测试问题")
    public Question answer(String answer){
        return service.answerQuestion(answer);
    }
    @GetMapping("endtest")
    @Operation(summary = "结束人格测试")
    public String endTest(){
        return service.queryResult();
    }

}
